using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using System.ComponentModel;

namespace MRSite.Entity
{
    /// <summary>
    /// 红包日志表
    /// </summary>
    [Table(Name = "gfhongbaolog")]
    public class GfHongbaolog : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "user_id")]
        public int user_id { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "user_name")]
        public String user_name { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Column(Name = "title")]
        public String title { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "val")]
        public Decimal val { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "remark")]
        public String remark { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime", IsDbGenerated = true)]
        public DateTime addtime { get; set; }

        /// <summary>
        ///提现，充值，购物消费，量碰，层碰，见定，其他
        /// </summary>
        [Column(Name = "tradetype")]
        public String tradetype { get; set; }

        /// <summary>
        ///币种:XJB现金币,CFXFB重复消费币,GWB购物币
        /// </summary>
        [Column(Name = "feetype")]
        public String feetype { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "levels")]
        public int levels { get; set; }

        /// <summary>
        /// 类别 1: 锁仓； 3:商城收益
        /// </summary>
        [Column(Name = "type")]
        public int type { get; set; }


        /// <summary>
        /// 基于见点奖的公排id
        /// </summary>
        [Column(Name = "jiandian_userid"), DefaultValue(0)]
        public int jiandian_userid { get; set; }

        /// <summary>
        /// 操作后余额
        /// </summary>
        [Column(Name = "balance")]
        public decimal balance { get; set; }


        private EntityRef<Customer> _member;

        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "user_id", OtherKey = "id")]
        public Customer CustomerItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }
    }
}

